Moving sequential sectors within a block of information in a flash memory mass storage architecture

ABSTRACT

A method and apparatus is disclosed for increasing the system performance of a digital system having a controller for controlling nonvolatile devices for storing blocks of information, each block having a group of sectors. When sectors within a block are being re-written in sequential order, the controller writes the new sector information into a sector location of another block without the need to move any of the sectors within the original block thereby reducing the number of read and write cycles needed to avoid erase-before-write operations. A `used` flag, stored in the sector location of each block, indicates that the sector has been transferred to another block or, alternatively, a move locator word maintains status information regarding the position of the sectors within the block that have been moved.

CROSS REFERENCE TO RELATED APPLICATION

This application is a continuation-in-part of a prior U.S. applicationwith Ser. No. 08/831,266, filed Mar. 31, 1997 and entitled "MOVINGSECTORS WITHIN A BLOCK OF INFORMATION IN A FLASH MEMORY MASS STORAGEARCHITECTURE", which is a continuation-in-part of another prior U.S.application with Ser. No. 08/509,706, filed Jul. 31, 1995 and entitled"DIRECT LOGICAL BLOCK ADDRESSING FLASH MEMORY MASS STORAGEARCHITECTURE".

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates to the field of mass storage for computers. Moreparticularly, this invention relates to an architecture for replacing ahard disk with a semiconductor nonvolatile memory and in particularflash memory.

2. Description of the Prior Art

Computers conventionally use rotating magnetic media for mass storage ofdocuments, data, programs and information. Though widely used andcommonly accepted, such hard disk drives suffer from a variety ofdeficiencies. Because of the rotation of the disk, there is an inherentlatency in extracting information from a hard disk drive.

Other problems are especially dramatic in portable computers. Inparticular, hard disks are unable to withstand many of the kinds ofphysical shock that a portable computer will likely sustain. Further,the motor for rotating the disk consumes significant amounts of powerdecreasing the battery life for portable computers.

Solid state memory is an ideal choice for replacing a hard disk drivefor mass storage because it can resolve the problems cited above.Potential solutions have been proposed for replacing a hard disk drivewith a semiconductor memory. For such a system to be truly useful, thememory must be nonvolatile and alterable. The inventors have determinedthat FLASH memory is preferred for such a replacement.

FLASH memory is a transistor memory cell which is programmable throughhot electron, source injection, or tunneling, and erasable throughFowler-Nordheim tunneling. The programming and erasing of such a memorycell requires current to pass through the dielectric surroundingfloating gate electrode. Because of this, such types of memory have afinite number of erase-write cycles. Eventually, the dielectricdeteriorates. Manufacturers of FLASH cell devices specify the limit forthe number of erase-write cycles between 100,000 and 1,000,000.

One requirement for a semiconductor mass storage device to be successfulis that its use in lieu of a rotating media hard disk mass storagedevice be transparent to the designer and the user of a system usingsuch a device. In other words, the designer or user of a computerincorporating such a semiconductor mass storage device could simplyremove the hard disk and replace it with a semiconductor mass storagedevice. All presently available commercial software should operate on asystem employing such a semiconductor mass storage device without thenecessity of any modification.

SanDisk proposed an architecture for a semiconductor mass storage usingFLASH memory at the Silicon Valley PC Design Conference on Jul. 9, 1991.That mass storage system included read-write block sizes of 512 Bytes toconform with commercial hard disk sector sizes.

Earlier designs incorporated erase-before-write architectures. In thisprocess, in order to update a file on the media, if the physicallocation on the media was previously programmed, it has to be erasedbefore the new data can be reprogrammed.

This process would have a major deterioration on overall systemthroughput. When a host writes a new data file to the storage media, itprovides a logical block address to the peripheral storage deviceassociated with this data file. The storage device then translates thisgiven logical block address to an actual physical block address on themedia and performs the write operation. In magnetic hard disk drives,the new data can be written over the previous old data with nomodification to the media. Therefore, once the physical block address iscalculated from the given logical block address by the controller, itwill simply write the data file into that location. In solid statestorage, if the location associated with the calculated physical blockaddress was previously programmed, before this block can be reprogrammedwith the new data, it has to be erased. In one previous art, inerase-before-write architecture where the correlation between logicalblock address given by the host is one to one mapping with physicalblock address on the media. This method has many deficiencies. First, itintroduces a delay in performance due to the erase operation beforereprogramming the altered information. In solid state flash, erase is avery slow process.

Secondly, hard disk users typically store two types of information, oneis rarely modified and another which is frequently changed. For example,a commercial spread sheet or word processing software program stored ona user's system are rarely, if ever, changed. However, the spread sheetdata files or word processing documents are frequently changed. Thus,different sectors of a hard disk typically have dramatically differentusage in terms of the number of times the information stored thereon ischanged. While this disparity has no impact on a hard disk because ofits insensitivity to data changes, in a FLASH memory device, thisvariance can cause sections of the mass storage to wear out and beunusable significantly sooner than other sections of the mass storage.

In another architecture, the inventors previously proposed a solution tostore a table correlating the logical block address to the physicalblock address. The inventions relating to that solution are disclosed inU.S. patent application Ser. No. 08/038,668 filed on Mar. 26, 1993 nowU.S. Pat. No. 5,388,083, and U.S. patent application Ser. No. 08/037,893also filed on Mar. 26, 1993 now U.S. Pat. No. 5,479,638. Thoseapplications are incorporated herein by reference.

The inventors' previous solution discloses two primary algorithms and anassociated hardware architecture for a semiconductor mass storagedevice. It will be understood that "data file" in this patent documentrefers to any computer file including commercial software, a userprogram, word processing software document, spread sheet file and thelike. The first algorithm in the previous solution provides means foravoiding an erase operation when writing a modified data file back ontothe mass storage device. Instead, no erase is performed and the modifieddata file is written onto an empty portion of the mass storage.

The semiconductor mass storage architecture has blocks sized to conformwith commercial hard disk sector sizes. The blocks are individuallyerasable. In one embodiment, the semiconductor mass storage can besubstituted for a rotating hard disk with no impact to the user, so thatsuch a substitution will be transparent. Means are provided for avoidingthe erase-before-write cycle each time information stored in the massstorage is changed.

According to the first algorithm, erase cycles are avoided byprogramming an altered data file into an empty block. This wouldordinarily not be possible when using conventional mass storage becausethe central processor and commercial software available in conventionalcomputer systems are not configured to track continually changingphysical locations of data files. The previous solution includes aprogrammable map to maintain a correlation between the logical addressand the physical address of the updated information files.

All the flags, and the table correlating the logical block address tothe physical block address are maintained within an array of CAM cells.The use of the CAM cells provides very rapid determination of thephysical address desired within the mass storage, generally within oneor two clock cycles. Unfortunately, as is well known, CAM cells requiremultiple transistors, typically six. Accordingly, an integrated circuitbuilt for a particular size memory using CAM storage for the tables andflags will need to be significantly larger than a circuit using othermeans for just storing the memory.

The inventors proposed another solution to this problem which isdisclosed in U.S. patent application Ser. No. 08/131,495 filed on Oct.4, 1993 now U.S. Pat. No. 5,485,595. That application is incorporatedherein by reference.

This additional previous solution invented by these same inventors isalso for a nonvolatile memory storage device. The device is alsoconfigured to avoid having to perform an erase-before-write each time adata file is changed by keeping a correlation between logical blockaddress and physical block address in a volatile space management RAM.Further, this invention avoids the overhead associated with CAM cellapproaches which require additional circuitry.

Like the solutions disclosed above by these same inventors, the deviceincludes circuitry for performing the two primary algorithms and anassociated hardware architecture for a semiconductor mass storagedevice. In addition, the CAM cell is avoided in this previous solutionby using RAM cells.

Reading is performed in this previous solutions by providing the logicalblock address to the memory storage. The system sequentially comparesthe stored logical block addresses until it finds a match. That datafile is then coupled to the digital system. Accordingly, the performanceoffered by this solution suffers because potentially all of the memorylocations must be searched and compared to the desired logical blockaddress before the physical location of the desired information can bedetermined.

What is needed is a semiconductor hard disk architecture which providesrapid access to stored data without the excessive overhead of CAM cellstorage.

SUMMARY OF THE INVENTION

The present invention is for a nonvolatile memory storage device. Thedevice is configured to avoid having to perform an erase-before-writeeach time a data file is changed. Further, to avoid the overheadassociated with CAM cells, this approach utilizes a RAM array. The hostsystem maintains organization of the mass storage data by using alogical block address. The RAM array is arranged to be addressable bythe same address as the logical block addresses (LBA) of the host. Eachsuch addressable location in the RAM includes a field which holds thephysical address of the data in the nonvolatile mass storage expected bythe host. This physical block address (PBA) information must be shadowedin the nonvolatile memory to ensure that the device will still functionafter resuming operation after a power down because RAMs are volatilememory devices. In addition, status flags are also stored for eachphysical location. The status flags can be stored in either thenonvolatile media or in both the RAM and in the nonvolatile media.

The device includes circuitry for performing two primary algorithms andan associated hardware architecture for a semiconductor mass storagedevice. The first algorithm provides a means for mapping of host logicalblock address to physical block address with much improved performanceand minimal hardware assists. In addition, the second algorithm providesmeans for avoiding an erase-before-write cycle when writing a modifieddata file back onto the mass storage device. Instead, no erase isperformed and the modified data file is written onto an empty portion ofthe mass storage.

Reading is performed in the present invention by providing the logicalblock address to the memory storage. The RAM array is arranged so thatthe logical block address selects one RAM location. That locationcontains the physical block address of the data requested by the host orother external system. That data file is then read out to the host.

According to the second algorithm, erase cycles are avoided byprogramming an altered data file into an altered data mass storage blockrather than itself after an erase cycle of the block as done on previousarts.

In an alternative embodiment of the present invention, a method andapparatus is presented for efficiently moving sectors within a blockfrom a first area within the nonvolatile memory to an unused area withinthe nonvolatile memory and marking the first area as "used".

Briefly, A preferred embodiment of the present invention includes amethod and apparatus for storing mapping information for mapping alogical block address identifying a block being accessed by a host to aphysical block address, identifying a free area of nonvolatile memory,the block being selectively erasable and having one or more sectors thatmay be individually moved. The mapping information including a virtualphysical block address for identifying an "original" location, withinthe nonvolatile memory, wherein a block is stored and a moved virtualphysical block address for identifying a "moved" location, within thenonvolatile memory, wherein one or more sectors of the stored block aremoved. The mapping information further including status information foruse of the "original" physical block address and the "moved" physicalblock address and for providing information regarding "moved" sectorswithin the block being accessed.

IN THE DRAWINGS

FIG. 1 shows a schematic block diagram of an architecture for asemiconductor mass storage according to the present invention.

FIG. 2 shows an alternative embodiment to the physical block address 102of the RAM storage of FIG. 1.

FIG. 3 shows a block diagram of a system incorporating the mass storagedevice of the present invention.

FIGS. 4-8 show the status of several of the flags and information forachieving the advantages of the present invention.

FIG. 9 shows a flow chart block diagram of the first algorithm accordingto the present invention.

FIG. 10 shows a high-level block diagram of a digital system, such as adigital camera, including a preferred embodiment of the presentinvention.

FIGS. 11-21 illustrate several examples of the state of a mapping tablethat may be stored in the digital system of FIG. 10 including LBA-PBAmapping information.

FIG. 22 depicts an example of a nonvolatile memory device employed inthe preferred embodiment of FIG. 10.

FIG. 23 shows a high-level flow chart of the general steps employed inwriting a block of information to the nonvolatile devices of FIG. 10.

FIGS. 24-26 generally show, in flow chart form, the operation of anotherpreferred embodiment of the present invention employing singlesequential sector move operations.

FIGS. 27 shows an example after initialization of the system of thecontents of the lookup table in SPM RAM 548.

FIG. 28 illustrates an example to the contents of the memory unit 508 ofthe preferred embodiment described in FIGS. 24-26.

FIGS. 29-38 depict examples of the contents of the SPM RAM look-up-tablein accordance with the preferred embodiments as shown in FIGS. 24-28.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

FIG. 1 shows an architecture for implementation of a solid state storagemedia according to the present invention. The storage media is for usewith a host or other external digital system. The mass storage ispartitioned into two portions, a volatile RAM array 100 and anonvolatile array 104. According to the preferred embodiment, all of thenonvolatile memory storage is FLASH. The FLASH may be replaced byEEPROM. The RAM can be of any convenient type. The memory storage 104 isarranged into N blocks of data from zero through N-1. Each of the blocksof data is M Bytes long. In the preferred embodiment, each data block is512 Bytes long to correspond with a sector length in a commerciallyavailable hard disk drive plus the extra numbers of bytes to store theflags and logical block address (LBA) information and the associatedECC. The memory 104 can contain as much memory storage as a userdesires. An example of a mass storage device might include 100 M Byte ofaddressable storage.

There are a plurality of RAM locations 102. Each RAM location 102 isuniquely addressable by controller using an appropriate one of thelogical block addresses provided by the host system or the actualphysical address of the nonvolatile media. The RAM location 102 containsthe physical block address of the data associated with the logical blockaddress and the flags associated with a physical block address on thenonvolatile media.

It is possible that the physical block address (PBA) can be split intotwo fields as shown in FIG. 2. These fields can be used for clusteraddresses of a group of data blocks. The first such field 290 is used toselect a cluster address and the second such field 292 can be used toselect the start address of the logical block address associated withthis cluster.

A collection of information flags is also stored for each nonvolatilememory location 106. These flags include an old/new flag 110, aused/free flag 112, a defect flag 114, and a single/sector flag 116.Additionally, there is also a data store 122.

When writing data to the mass storage device of the present invention, acontroller determines the first available physical block for storing thedata. The RAM location 102 corresponding to the logical block addressselected by the host is written with the physical block address wherethe data is actually stored within the nonvolatile memory array in 104(FIG. 1).

Assume for example that a user is preparing a word processing documentand instructs the computer to save the document. The document will bestored in the mass storage system. The host system will assign it alogical block address. The mass storage system of the present inventionwill select a physical address of an unused block or blocks in the massstorage for storing the document. The address of the physical blockaddress will be stored into the RAM location 102 corresponding to thelogical block address. As the data is programmed, the system of thepresent invention also sets the used free flag 112 in 104 and 293 toindicate that this block location is used. One used/free flag 112 isprovided for each entry of the nonvolatile array 104.

Later, assume the user retrieves the document, makes a change and againinstructs the computer to store the document. To avoid anerase-before-write cycle, the system of the present invention providesmeans for locating a block having its used/free flag 112 in 100 unset(not programmed) which indicates that the associated block is erased.The system then sets the used/free flag for the new block 112 of 106 and293 of 100 and then stores the modified document in that new physicalblock location 106 in the nonvolatile array 104. The address of the newphysical block location is also stored into the RAM location 102corresponding the logical block address, thereby writing over theprevious physical block location in 102. Next, the system sets theold/new flag 110 of the previous version of the document indicating thatthis is an old unneeded version of the document in 110 of 104 and 293 of109. In this way, the system of the present invention avoids theoverhead of an erase cycle which is required in the erase-before-writeof conventional systems to store a modified version of a previousdocument.

Because of RAM array 100 will lose its memory upon a power downcondition, the logical block address with the active physical blockaddress in the media is also stored as a shadow memory 108 in thenonvolatile array 104. It will be understood the shadow information willbe stored into the appropriate RAM locations 102 by the controller.During power up sequence, the RAM locations in 100 are appropriatelyupdated from every physical locations in 104, by reading the information106 of 104. The logical address 108 of 106 is used to address the RAMlocation of 100 to update the actual physical block address associatedwith the given logical block address. Also since 106 is the actualphysical block address associated with the new data 122, the flags 110,112, 114, and 116 are updated in 293 of 102 with the physical blockaddress of 106 in 100. It will be apparent to one of ordinary skill inthe art that the flags can be stored in either the appropriatenonvolatile memory location 106 or in both the nonvolatile memorylocation and also in the RAM location 102 associated with the physicalblock address.

During power up, in order to assign the most recent physical blockaddress assigned to a logical block address in the volatile memory 100,the controller will first read the Flags 110, 112, 114, and 116 portionof the nonvolatile memory 104 and updates the flags portion 293 in thevolatile memory 100. Then it reads the logical block address 108 ofevery physical block address of the nonvolatile media 104 and bytracking the flags of the given physical block address in the volatilememory 100, and the read logical block address of the physical blockaddress in the nonvolatile memory 104, it can update the most recentphysical block address assigned to the read logical block address in thevolatile memory 100.

FIG. 3 shows a block diagram of a system incorporating the mass storagedevice of the present invention. An external digital system 300 such asa host computer, personal computer and the like is coupled to the massstorage device 302 of the present invention. A logical block address iscoupled via an address bus 306 to the volatile RAM array 100 and to acontroller circuit 304. Control signals are also coupled to thecontroller 304 via a control bus 308. The volatile RAM array 100 iscoupled for providing the physical block address to the nonvolatilearray 104. The controller 304 is coupled to control both the volatileRAM 100, the nonvolatile array 104, and for the generation of all flags.

A simplified example, showing the operation of the write operationaccording to the present invention is shown in FIGS. 4 through 8. Notall the information flags are shown to avoid obscuring these features ofthe invention in excessive detail. The data entries are shown usingdecimal numbers to further simplify the understanding of the invention.It will be apparent to one of ordinary skill in the art that in apreferred embodiment binary counting will be used.

FIG. 4 shows an eleven entry mass storage device according to thepresent invention. There is no valid nor usable data stored in the massstorage device of FIG. 4. Accordingly, all the physical block addressesare empty. The data stored in the nonvolatile mass storage location `6`is filled and old. Additionally, location `9` is defective and cannot beused.

The host directs the mass storage device of the example to write datapursuant to the logical block address `3` and then to `4`. The massstorage device will first write the data associated with the logicalblock address `3`. The device determines which is the first unusedlocation in the nonvolatile memory. In this example, the first emptylocation is location `0`. Accordingly, FIG. 5 shows that for the logicalblock address `3`, the corresponding physical block address `0` isstored and the used flag is set in physical block address `0`. The nextempty location is location `1`. FIG. 6 shows that for the logical blockaddress `4`, the corresponding physical block address `1` is stored andthe used flag is set in physical block address `1`.

The host instructs that something is to be written to logical blockaddress `3` again. The next empty location is determined to be location`2`. FIG. 7 shows that the old flag in location `0` is set to indicatethat this data is no longer usable, the used flag is set in location `2`and the physical block address in location `3` is changed to `2`.

Next, the host instructs that something is to be written to logicalblock address `4` again. The next empty location is determined to belocation `3`. FIG. 8 shows that the old flag in location `1` is set toindicate that this data is no longer usable, the used flag is set inlocation `3` and the physical block address in location `4` is changedto `3`. (Recall that there is generally no relation between the physicalblock address and the data stored in the same location.)

FIG. 9 shows algorithm 1 according to the present invention. When thesystem of the present invention receives an instruction to program datainto the mass storage (step 200), then the system attempts to locate afree block (step 202), i.e., a block having an unset (not programmed)used/free flag. If successful, the system sets the used/free flag forthat block and programs the data into that block (step 206).

If on the other hand, the system is unable to locate a block having anunset used/free flag, the system erases the flags (used/free andold/new) and data for all blocks having a set old/new flag and unsetdefect flag (step 204) and then searches for a block having an unsetused/free flag (step 202). Such a block has just been formed by step204. The system then sets the used/flag for that block and programs thedata file into that block (step 206).

If the data is a modified version of a previously existing file, thesystem must prevent the superseded version from being accessed. Thesystem determines whether the data file supersedes a previous data file(step 208). If so, the system sets the old/new flag associated with thesuperseded block (step 210). If on the other hand, the data file to bestored is a newly created data file, the step of setting the old/newflag (step 210) is skipped because there is no superseded block. Lastly,the map for correlating the logical address 308 to the physical addressis updated (step 212).

By following the procedure outlined above, the overhead associated withan erase cycle is avoided for each write to the memory 104 except forperiodically. This vastly improves the performance of the overallcomputer system employing the architecture of the present invention.

In the preferred embodiment of the present invention, the programming ofthe flash memory follows the procedure commonly understood by those ofordinary skill in the art. In other words, the program impulses areappropriately applied to the bits to be programmed and then compared tothe data being programmed to ensure that proper programming hasoccurred. In the event that a bit fails to be erased or programmedproperly, a defect flag 114 is set which prevent that block from beingused again.

FIG. 10 depicts a digital system 500 such as a digital camera employingan alternative embodiment of the present invention. Digital system 500is illustrated to include a host 502, which may be a personal computer(PC) or simply a processor of any generic type commonly employed indigital systems, coupled to a controller circuit 506 for storing in andretrieving information from non-volatile memory unit 508.

The controller circuit 506 may be a semiconductor (otherwise referred toas an "integrated circuit" or "chip") or optionally a combination ofvarious electronic components. In the preferred embodiment, thecontroller circuit is depicted as a single chip device. The non-volatilememory unit 508 is comprised of one or more memory devices, which mayeach be flash or EEPROM types of memory. In the preferred embodiment ofFIG. 10, memory unit 508 includes a plurality of flash memory devices,510-512, each flash device includes individually addressable locationsfor storing information. In the preferred application of the embodimentin FIG. 10, such information is organized in blocks with each blockhaving one or more sectors of data. In addition to the data, theinformation being stored may further include status informationregarding the data blocks, such as flag fields, address information andthe like.

The host 502 is coupled through host information signals 504 to acontroller circuit 506. The host information signals comprise of addressand data busses and control signals for communicating command, data andother types of information to the controller circuit 506, which in turnstores such information in memory unit 508 through flash address bus512, flash data bus 514, flash signals 516 and flash status signals 518(508 and 513-516 collectively referred to as signals 538). The signals538 may provide command, data and status information between thecontroller 506 and the memory unit 508.

The controller 506 is shown to include high-level functional blocks suchas a host interface block 520, a buffer RAM block 522, a flashcontroller block 532, a microprocessor block 524, a microprocessorcontroller block 528, a microprocessor storage block 530, amicroprocessor ROM block 534, an ECC logic block 540 and a space managerblock 544. The host interface block 520 receives host informationsignals 504 for providing data and status information from buffer RAMblock 522 and microprocessor block 524 to the host 502 through hostinformation signals 504. The host interface block 520 is coupled to themicroprocessor block 524 through the microprocessor information signals526, which is comprised of an address bus, a data bus and controlsignals.

The microprocessor block 524 is shown coupled to a microprocessorcontroller block 528, a microprocessor storage block 530 and amicroprocessor ROM block 534, and serves to direct operations of thevarious functional blocks shown in FIG. 10 within the controller 506 byexecuting program instructions stored in the microprocessor storageblock 530 and the microprocessor ROM block 534. Microprocessor 524 may,at times, execute program instructions (or code) from microprocessor ROMblock 534, which is a non-volatile storage area. On the other hand,microprocessor storage block 530 may be either volatile, i.e.,read-and-write memory (RAM), or nonvolatile, i.e., EEPROM, type ofmemory storage. The instructions executed by the microprocessor block524, collectively referred to as program code, are stored in the storageblock 530 at some time prior to the beginning of the operation of thesystem of the present invention. Initially, and prior to the executionof program code from the microprocessor storage location 530, theprogram code may be stored in the memory unit 508 and later downloadedto the storage block 530 through the signals 538. During thisinitialization, the microprocessor block 524 can execute instructionsfrom the ROM block 534.

Controller 506 further includes a flash controller block 532 coupled tothe microprocessor block 524 through the microprocessor informationsignals 526 for providing and receiving information from and to thememory unit under the direction of the microprocessor. Information suchas data may be provided from flash controller block 532 to the bufferRAM block 522 for storage (may be only temporary storage) thereinthrough the microprocessor signals 526. Similarly, through themicroprocessor signals 526, data may be retrieved from the buffer RAMblock 522 by the flash controller block 532.

ECC logic block 540 is coupled to buffer RAM block 522 through signals542 and further coupled to the microprocessor block 524 throughmicroprocessor signals 526. ECC logic block 540 includes circuitry forgenerally performing error coding and correction functions. It should beunderstood by those skilled in the art that various ECC apparatus andalgorithms are commercially available and may be employed to perform thefunctions required of ECC logic block 540. Briefly, these functionsinclude appending code that is for all intensive purposes uniquelygenerated from a polynomial to the data being transmitted and when datais received, using the same polynomial to generate another code from thereceived data for detecting and potentially correcting a predeterminednumber of errors that may have corrupted the data. ECC logic block 540performs error detection and/or correction operations on data stored inthe memory unit 508 or data received from the host 502.

The space manager block 544 employs a preferred apparatus and algorithmfor finding the next unused (or free) storage block within one of theflash memory devices for storing a block of information, as will befurther explained herein with reference to other figures. As earlierdiscussed, the address of a block within one of the flash memory devicesis referred to as PBA, which is determined by the space manager byperforming a translation on an LBA received from the host. A variety ofapparatus and method may be employed for accomplishing this translation.An example of such a scheme is disclosed in U.S. Pat. No. 5,485,595,entitled "Flash Memory Mass Storage Architecture Incorporating WearLeveling Technique Without Using CAM Cells", the specification of whichis herein incorporated by reference. Other LBA to PBA translationmethods and apparatus may be likewise employed without departing fromthe scope and spirit of the present invention.

Space manager block 544 includes SPM RAM block 548 and SPM control block546, the latter two blocks being coupled together. The SPM RAM block 548stores the LBA-PBA mapping information (otherwise herein referred to astranslation table, mapping table, mapping information, or table) underthe control of SPM control block 546. Alternatively, the SPM RAM block548 may be located outside of the controller, such as shown in FIG. 3with respect to RAM array 100.

In operation, the host 502 writes and reads information from and to thememory unit 508 during for example, the performance of a read or writeoperation through the controller 506. In so doing, the host 502 providesan LBA to the controller 506 through the host signals 504. The LBA isreceived by the host interface block 520. Under the direction of themicroprocessor block 524, the LBA is ultimately provided to the spacemanager block 544 for translation to a PBA and storage thereof, as willbe discussed in further detail later.

Under the direction of the microprocessor block 524, data and otherinformation are written into or read from a storage area, identified bythe PBA, within one of the flash memory devices 510-512 through theflash controller block 532. The information stored within the flashmemory devices may not be overwritten with new information without firstbeing erased, as earlier discussed. On the other hand, erasure of ablock of information (every time prior to being written), is a very timeand power consuming measure. This is sometimes referred to aserase-before-write operation. The preferred embodiment avoids such anoperation by continuously, yet efficiently, moving a sector (or multiplesectors) of information, within a block, that is being re-written from aPBA location within the flash memory to an unused PBA location withinthe memory unit 508 thereby avoiding frequent erasure operations. Ablock of information may be comprised of more than one sector such as 16or 32 sectors. A block of information is further defined to be anindividually-erasable unit of information. In the past, prior artsystems have moved a block stored within flash memory devices that hasbeen previously written into a free (or unused) location within theflash memory devices. Such systems however, moved an entire block evenwhen only one sector of information within that block was beingre-written. In other words, there is waste of both storage capacitywithin the flash memory as well as waste of time in moving an entireblock's contents when less than the total number of sectors within theblock are being re-written. The preferred embodiments of the presentinvention, as discussed herein, allow for "moves" of less than a blockof information thereby decreasing the number of move operations ofpreviously-written sectors, consequently, decreasing the number of eraseoperations.

Referring back to FIG. 10, it is important to note that the SPM RAMblock 548 maintains a table that may be modified each time a writeoperation occurs thereby maintaining the LBA-PBA mapping information andother information regarding each block being stored in memory unit 508.Additionally, this mapping information provides the actual location of asector (within a block) of information within the flash memory devices.As will be further apparent, at least a portion of the information inthe mapping table stored in the SPM RAM block 548 is "shadowed" (orcopied) to memory unit 508 in order to avoid loss of the mappinginformation when power to the system is interrupted or terminated. Thisis, in large part, due to the use of volatile memory for maintaining themapping information. In this connection, when power to the system isrestored, the portion of the mapping information stored in the memoryunit 508 is transferred to the SPM RAM block 548.

It should be noted, that the SPM RAM block 548 may alternatively benonvolatile memory, such as in the form of flash or EEPROM memoryarchitecture. In this case, the mapping table will be stored withinnonvolatile memory thereby avoiding the need for "shadowing" becauseduring power interruptions, the mapping information stored innonvolatile memory will be clearly maintained.

When one or more sectors are being moved from one area of the flashmemory to another area, the preferred embodiment of the presentinvention first moves the sector(s) from the location where they arestored in the flash memory devices, i.e., 510-512, to the buffer RAMblock 522 for temporary storage therein. The moved sector(s) are thenmoved from the buffer RAM block 522 to a free area within one of theflash memory devices. It is further useful to note that the ECC codegenerated by the ECC logic block 540, as discussed above, is also storedwithin the flash memory devices 510-512 along with the data, as is otherinformation, such as the LBA corresponding to the data and flag fields.

FIGS. 11-21 are presented to show examples of the state of a table 700in SPM RAM block 548 configured to store LBA-PBA mapping information foridentification and location of blocks (and sectors within the blocks)within the memory unit 508. Table 700 in all of these figures is shownto include an array of columns and rows with the columns includingvirtual physical block address locations or VPBA block address locations702, move virtual physical address locations or MVPBA block addresslocations 704, move flag locations 706, used/free flag locations 708,old/new flag locations 710, defect flag locations 712 and sector movestatus locations 714.

The rows of table include PBA/LBA rows 716, 718 through 728 with eachrow having a row number that may be either an LBA or a PBA dependingupon the information that is being addressed within the table 700. Forexample, row 716 is shown as being assigned row number `00` and if PBAinformation in association with LBA `00` is being retrieved from table700, then LBA `00` may be addressed in SPM RAM block 548 at row 716 toobtain the associated PBA located in 730. On the other hand, if statusinformation, such as flag fields, 706-712, regarding a block is beingaccessed, the row numbers of rows 716-728, such as `00`, `10`, `20`,`30`, `40`, `50`, `N-1` represent PBA, as opposed to LBA, values.Furthermore, each row of table 700 may be thought of as a block entrywherein each entry contains information regarding a block. Furthermore,each row of table 700 may be addressed by an LBA.

In the preferred embodiment, each block is shown to include 16 sectors.This is due to the capability of selectively erasing an entire block of16 sectors (which is why the block size is sometimes referred to as an"erase block size". If an erase block size is 16 sectors, such as shownin FIGS. 11-21, each block entry (or row) includes information regarding16 sectors. Row 716 therefore includes information regarding a blockaddressed by LBA `00` through LBA `15` (or LBA `00` through LBA `0F` inHex. notation). The next row, row 718, includes information regardingblocks addressed by LBA `16` (or `10` in Hex.) through LBA `31` (or `1F`in Hex.) The same is true for PBAs of each block.

It should be noted however, other block sizes may be similarly employed.For example, a block may include 32 sectors and therefore have an eraseblock size of 32. In the latter situation, each block entry or row, suchas 716, 718, 720 . . . , would include information regarding 32 sectors.

The VPBA block address locations 702 of table 700 stores informationgenerally representing a PBA value corresponding to a particular LBAvalue. The MVPBA block address locations 704 store informationrepresenting a PBA value identifying, within the memory unit 508, thelocation of where a block (or sector portions thereof) may have beenmoved. The move flag locations 706 store values indicating whether theblock being accessed has any sectors that may have been moved to alocation whose PBA is indicated by the value in the MVPBA block addresslocation 704 (the PBA value within 704 being other than the valueindicated in VPBA block address 702 wherein the remaining block addressinformation may be located). The used/new flag location 708 storesinformation to indicate whether the block being accessed is a freeblock, that is, no data has been stored since the block was last erased.The old/new flag location 710 stores information representing the statusof the block being accessed as to whether the block has been used andre-used and therefore, old. The defect flag location 712 storesinformation regarding whether the block is defective. If a block isdeclared defective, as indicated by the value in the defect flaglocation 712 being set, the defective block can no longer be used. Flags708-712 are similar to the flags 110-114 shown and described withrespect to FIG. 1.

Sector move status location 714 is comprised of 16 bits (location 714includes a bit for each sector within a block so for different-sizedblocks, different number of bits within location 714 are required) witheach bit representing the status of a sector within the block as towhether the sector has been moved to another block within the memoryunit 508. The moved block location within the memory unit 508 would beidentified by a PBA that is other than the PBA value in VPBA blockaddress location 702. Said differently, the status of whether a sectorwithin a block has been moved, as indicated by each of the bits within714, suggests which one of either the VPBA block address locations 702or the MBPBA block address locations 704 maintain the most recent PBAlocation for that sector.

Referring still to FIG. 11, an example of the status of the table 700stored in SPM RAM block 548 (in FIG. 10) is shown when, by way ofexample, LBA `0` is being written. As previously noted, in the figurespresented herein, a block size of sixteen sectors (number 0-15 indecimal notation or 0-10 in hexadecimal notation) is used to illustrateexamples only. Similarly, N blocks (therefore N LBAS) are employed,numbered from 0-N-1. The block size and the number of blocks are bothdesign choices that may vary for different applications and may dependupon the memory capacity of each individual flash memory device (such as510-512) being employed. Furthermore, a preferred sector size of 512bytes is used in these examples whereas other sector sizes may beemployed without departing from the scope and spirit of the presentinvention.

Assuming that the operation of writing to LBA `0` is occurring afterinitialization or system power-up when all of the blocks within theflash memory devices 510-512 (in FIG. 10) have been erased and are thusfree. The space manager block 548 is likely to determine that the nextfree PBA location is `00`. Therefore, `00` is written to 730 in VPBAblock address 702 of row 716 wherein information regarding LBA `0` ismaintained, as indicated in table 700 by LBA row number `00`. Since noneed exists for moving any of the sectors within the LBA 0 block, theMVPBA block address 704 for row 716, which is shown as location 732 mayinclude any value, such as an initialization value (in FIG. 11, `XX` isshown to indicate a "don't care" state).

The value in 734 is at logic state `0` to show that LBA `0` block doesnot contain any moved sectors. Location 736 within the used flag 708column of row 716 will be set to logic state `1` indicating that the PBA`0` block is in use. The state of location 738, representing the oldflag 710 for row 716, is set to `0` to indicate that PBA `0` block isnot "old" yet. Location 740 maintains logic state `0` indicating thatthe PBA `0` block is not defective and all of the bits in move statuslocation 714 are at logic state `0` to indicate that none of the sectorswithin the LBA `0` through LBA `15` block have been moved.

In FIG. 11, the status information for LBA `0` in row 716, such as inmove flag location 706, used flag location 708, old flag location 710,defect flag location 712 and move status location 714 for all remainingrows, 716-728, of table 700 are at logic state `0`. It is understoodthat upon power-up of the system and/or after erasure of any of theblocks, the entries for the erased blocks, which would be all blocksupon power-up, in table 700, are all set to logic state `0`.

At this time, a discussion of the contents of one of the flash memorydevices within the memory unit 508, wherein the LBA `0` block may belocated is presented for the purpose of a better understanding of themapping information shown in table 700 of FIG. 11.

Turning now to FIG. 22, an example is illustrated of the contents of theflash memory device 510 in accordance with the state of table 700 (asshown in FIG. 11). LBA `0`, which within the memory unit 508 isidentified at PBA `0` by controller 506 (of FIG. 10) is the locationwherein the host-identified block is written. A PBA0 row 750 is shown inFIG. 22 to include data in sector data location 752. An ECC code isfurther stored in ECC location 754 of PBA0 row 750. This ECC code isgenerated by the ECC logic block 540 in association with the data beingwritten, as previously discussed. Flag field 756 in PBA0 row 750contains the move, used, old and defect flag information correspondingto the sector data of the block being written. In this example, in flagfield 756, the "used" flag and no other flag is set, thus, flag field756 maintains a logic state of `0100` indicating that PBA `0` is "used"but not "moved", "old" or "defective".

PBA0 row 750 additionally includes storage location for maintaining inLBA address location 758, the LBA number corresponding to PBA `0`, whichin this example, is `0`. While not related to the example at hand, theremaining PBA locations of LBA `0` are stored in the next 15 rowsfollowing row 750 in the flash memory device 510.

It will be understood from the discussion of the examples providedherein that the information within a PBA row of flash memory device 510is enough to identify the data and status information relating theretowithin the LBA `0` block including any moves associated therewith,particularly due to the presence of the "move" flag within each PBA row(750, 762, 764,) of the flash memory. Nevertheless, alternatively,another field may be added to the first PBA row of each LBA locationwithin the flash, replicating the status of the bits in the move statuslocation 714 of the corresponding row in table 700. This field isoptionally stored in sector status location 760 shown in FIG. 22 to beincluded in the first PBA row of each LBA block, such as row 750, 780and so on. Although the information maintained in location 760 may befound by checking the status of the "move" flags within the flag fields756 of each PBA row, an apparent advantage of using location 760 is thatupon start-up (or power-on) of the system, the contents of table 700 inSPM RAM block 548 may be updated more rapidly due to fewer readoperations (the reader is reminded that table 700 is maintained in SPMRAM 548, which is volatile memory whose contents are lost when thesystem is power-down and needs to be updated upon power-up fromnonvolatile memory, i.e. memory unit 508).

That is, rather than reading every PBA row (altogether 16 rows in thepreferred example) to update each LBA entry of the table 700 uponpower-up, only the first PBA row of each LBA must be read from flashmemory and stored in SPM RAM 548 thereby saving time by avoidingneedless read operations. On the other hand, clearly more memorycapacity is utilized to maintain 16 bits of sector status informationper LBA.

In the above example, wherein location 760 is used, the value in sectorstatus location 760 would be all `0`s (or `0000` in hexadecimalnotation).

In flash memory device 510, each of the rows 750, 762, 764, 768 . . . ,is a PBA location with each row having a PBA row number and for storingdata and other information (data and other information are as discussedabove with respect to row 750) for a sector within a block addressed bya particular LBA. Furthermore, every sixteen sequential PBA rowsrepresents one block of information. That is, PBA rows 750, 762, 764through 768, which are intended to show 16 PBA rows correspond to LBA 0(shown as row 716 in table 700 of FIG. 11) and each of the PBA rowsmaintains information regarding a sector within the block. The nextblock of information is for the block addressed by LBA `10` (in Hex.)whose mapping information is included in row 718 of table 700, and whichis stored in locations starting from `10` (in hexadecimal notation, or`16` in decimal notation) and ending at `1F` (in hexadecimal notation,or `31`) in the flash memory device 510 and so on.

Continuing on with the above example, FIG. 12 shows an example of thestate of table 700 when LBA 0 is again being written by the host. SinceLBA 0 has already been written and is again being written without firstbeing erased, another free location within the memory unit 508 (it mayserve helpful to note here that the blocks, including their sectors, areorganized sequentially and continuously through each of the flash memorydevices of memory unit 508 according to their PBAs such that forexample, the next flash memory device following device 510 picks up thePBA-addressed blocks where flash memory device 510 left off, an exampleof this is where flash memory device 510 includes PBAs of 0-FF (in Hex.)and the next flash memory device, which may be 512, may then include100-1FF (in Hex.)) is located by space manager 544 for storage of thenew information. This free location is shown to be PBA `10` (inHexadecimal notation, or 16 in decimal notation). In row 718, where theentries for LBA `10` will remain the same as shown in FIG. 11 except theused flag in location 742 will be set (in the preferred embodiment, aflag is set when it is at logic state `1` although the opposite polaritymay be used without deviating from the present invention) to indicatethat the PBA `10` is now "in use".

The entries in row 716 are modified to show `10` in MVPBA block addresslocation 732, which provides the PBA address of the moved portion forthe LBA `00` block. The move flag in location 734 is set to logic state`1` to indicate that at least a portion (one or more sectors) of the LBA`00` block have been moved to a PBA location other than the PBA locationindicated in location 730 of table 700. Finally, the bits of the movestatus location 714 in row 716 are set to `1000000000000000` (in binarynotation, or `8000` in hexadecimal notation), reflecting the status ofthe moved sectors within the block LBA `00`. That is, in this example,`8000` indicates that the first sector, or sector `0`, within LBA `00`block has been moved to a different PBA location.

Referring now to FIG. 22, the state of table 700 in FIG. 12 will affectthe contents of the flash memory device 510 in that the moved sector ofthe LBA `0` block will now be written to PBA `10` in row 780. Row 780will then include the data for the moved sector, which is 512 bytes insize. With respect to the moved sector information, row 780 furtherincludes ECC code, a copy of the values in flag locations 734-740 oftable 700 (in FIG. 12), and LBA `00` for indicating that the data in row780 belongs to LBA `00` and may further include the move status for eachof the individual sectors within the LBA `0` block.

While not specifically shown in the figure, the move flag withinlocation 756 of PBA row 750 is set to indicate that at least a portionof the corresponding block has been moved. The value stored in the movestatus location 714 of row 716 (in FIG. 12), which is `8000` in Hex., isalso stored within location 760 of the row 750. As earlier noted, thisindicates that only sector `0` of PBA `0` was marked "moved" and the newblock LBA `0` was written to PBA `10` in flash memory. Without furtherdetailed discussions of FIG. 22, it should be appreciated that theexamples to follow likewise affect the contents of the flash memorydevice 510.

FIG. 13 shows the status of table 700 when yet another write operationto LBA `00` is performed. The values (or entries) in row 716 remain thesame as in FIG. 12 except that the value in location 732 is changed to`20` (in Hex. Notation) to indicate that the moved portion of block LBA`00` is now located in PBA location `20` (rather than `10` in FIG. 12).As in FIG. 12, the value in move status location 714, `8000`, indicatesthat the first sector (with PBA `00`) is the portion of the block thathas been moved.

Row 718 is modified to show that the LBA `10` block is now old and canno longer be used before it is erased. This is indicated by the value inlocation 744 being set to logic state `1`. The entries for LBA `20`, row720, remain unchanged except that location 746 is modified to be set tologic state `1` for reflecting the state of the PBA `20` block as beingin use. It is understood that as in FIGS. 11 and 12, all remainingvalues in table 700 of FIG. 13 that have not been discussed above andare not shown as having a particular logic state in FIG. 13 are allunchanged (the flags are all set to logic state `0`).

Continuing further with the above example, FIG. 14 shows the state oftable 700 when yet another write to LBA `0` occurs. For ease ofcomparison, there is a circle drawn around the values shown in FIG. 14,which are at a different logic state with respect to their states shownin FIG. 13. In row 716, everything remains the same except for the newmoved location, indicated as PBA `30`, shown in location 732. PBA `30`was the next free location found by the space manager 544. As previouslynoted, this value indicates that a portion of the block of LBA `0` isnow in PBA `30`; namely, the first sector (shown by the value in 714 ofrow 716 being `8000`) in that block has been moved to PBA `30` in theflash memory device 510.

Row 718 remains the same until it is erased. The flags in locations 742and 744 are set to logic state `0`. Row 720 also remains unchangedexcept for the value in its old flag 710 column being modified to `1` toshow that the block of PBA `20` is also old and can not be used untilfirst erased. Row 722 remains the same except for the value in its usedflag 708 column being changed to logic state `1` to show that the blockof LBA `30` is now in use.

FIG. 15 is another example of the state of table 700, showing the stateof table 700 assuming that the table was at the state shown in FIG. 13and followed by the host writing to LBA `5`. Again, the changes to thevalues in table 700 from FIG. 13 to FIG. 15 are shown by a circle drawnaround the value that has changed, which is only one change.

When writing to LBA `5`, it should be understood that the LBA entries ofrows 716, 718, 720, etc. are only for LBA `00`, LBA `10`, LBA `20`, soon, and therefore do not reflect an LBA `5` entry. The reader isreminded that each of the LBA row entries is for a block of informationwith each block being 16 sectors in the preferred embodiment. For thisreason, LBA `5` actually addresses the fifth sector in row 716. SincePBA `20` was used to store LBA `0`, only the sector within PBA `20`,corresponding to LBA `5`, is yet not written and "free". Therefore, thedata for LBA `5` is stored in PBA `20` in sector `5`. The move statuslocation 714 of row 716 will be modified to logic state `8400` (in Hex.Notation). This reflects that the location of the first and fifthsectors within LBA `0` are both identified at PBA `20` in the flashmemory device 510. The remaining values in table 700 of FIG. 15 remainthe same as those shown in FIG. 13.

FIGS. 16-18 show yet another example of what the state of table 700 maybe after either power-up or erasure of the blocks with the memory unit508. In FIGS. 16 and 17, the same write operations as those discussedwith reference to FIGS. 11 and 12 are performed. The state of table 700in FIGS. 16 and 17 resembles that of FIGS. 11 and 12, respectively (thelatter two figures have been re-drawn as FIGS. 16 and 17 for the soleconvenience of the reader). Briefly, FIG. 16 shows the state of table700 after a write to LBA `0` and FIG. 17 shows the state of table 700after another write to LBA `0`.

FIG. 18 picks up after FIG. 17 and shows the state of table 700 afterthe host writes to LBA `5`. As indicated in FIG. 18, LBA `5` has beenmoved to PBA `10` where LBA `0` is also located. To this end, MBPBAblock address location 732 is set to `10` in row 716 and the move flagis set at location 734 in the same row. Moreover, the state of movestatus location 714 in row 716 is set to `8400` (in Hex.) indicatingthat LBA `0` and LBA `5` have been moved, or that the first and fifthsectors within LBA `00` are moved. Being that these two sectors are nowlocated in the PBA `10` location of the flash memory device 510, themove flag for each of the these sectors are also set in the flash memorydevice 510. It should be understood that LBA `5` was moved to PBA `10`because remaining free sectors were available in that block. Namely,even with LBA `0` of that block having been used, 15 other sectors ofthe same block were available, from which the fifth sector is now in useafter the write to LBA `5`.

Continuing on with the example of FIG. 18, in FIG. 19, the state of thetable 700 is shown after the host writes yet another time to LBA `0`.According to the table, yet another free PBA location, `20`, is foundwhere both the LBA `5` and LBA `0` are moved. First, LBA `5` is moved tothe location PBA `10` to PBA `20` and then the new block of location LBA`0` is written to PBA `20`. As earlier discussed, any time there is amove of a block (for example, here the block of LBA `5` is moved) it isfirst moved from the location within flash memory where it currentlyresides to a temporary location within the controller 506, namely withthe buffer RAM block 522, and then it is transferred from there to thenew location within the flash memory devices.

The used flag in location 746 of row 720 is set to reflect the use ofthe PBA `20` location in flash memory and the old flag in location 744is set to discard use of PBA `10` location until it is erased. Again, inflash memory, the state of these flags as well as the state of the moveflag for both the LBA `0` and LBA `5` sectors are replicated.

FIG. 20 picks up from the state of the table 700 shown in FIG. 18 andshows yet another state of what the table 700 may be after the hostwrites to LBA `5`. In this case, the block of LBA `0` is first movedfrom location PBA `10` within the flash memory device 510 wherein it iscurrently stored to location PBA `20` of the flash memory. Thereafter,the new block being written to LBA `5` by the host is written intolocation PBA `20` of the flash memory. The flags in both table 700 andcorresponding locations of the flash memory device 510 are accordinglyset to reflect these updated locations.

FIG. 21 also picks up from the state of the table 700 shown in FIG. 18and shows the state of what the table 700 may be after the host writesto LBA `7`. In this case, the new block is simply written to locationPBA `10` of the flash memory since that location has not yet been used.Additionally, three of the bits of the move status location 714 in row716 are set to show that LBA `0`, LBA `5` and LBA `7` have been moved toanother PBA location within the flash memory. Location 732 shows thatthe location in which these three blocks are stored is PBA `10`.

As may be understood from the discussion presented thus far, at somepoint in time, the number of sectors being moved within a block makesfor an inefficient operation. Thus, the need arises for the user to seta threshold for the number of sectors within a block that may be movedbefore the block is declared "old" (the old flag is set) and the blockis no longer used, until it is erased. This threshold may be set at, forexample, half of the number of sectors within a block. This isdemonstrated as follows: For a block having 16 sectors, when 8 of thesectors are moved into another block, the "original" block and the"moved" block (the block in which the moved sectors reside) are combinedinto the same PBA block. The combined PBA block may be stored in a newblock altogether or, alternatively, the "original" block may be combinedwith and moved into the "moved" block. In the latter case, the"original" block is then marked as "old" for erasure thereof. If thecombined PBA block is stored in a new block, both of the "original" andthe "moved" blocks are marked as "old".

FIG. 23 depicts a general flow chart outlining some of the stepsperformed during a write operation. It is intended to show the sequenceof some of the events that take place during such an operation and isnot at all an inclusive presentation of the method or apparatus used inthe preferred embodiment of the present invention.

The steps as outlined in FIG. 23 are performed under the direction ofthe microprocessor block 524 as it executes program code (or firmware)during the operation of the system.

When the host writes to a block of LBA M, step 800, the space managerblock 544, in step 802, checks as to whether LBA M is in use by checkingthe state of the corresponding used flag in table 700 of the SPM RAMblock 548. If not in use, in step 804, a search is performed for thenext free PBA block in memory unit 508. If no free blocks are located,an "error" state is detected in 808. But where a free PBA is located, instep 806, its used flag is marked (or set) in table 700 as well as inflash memory. In step 810, the PBA of the free block is written into theVPBA block address 702 location of the corresponding LBA row in table700.

Going back to step 802, if the LBA M block is in use, search for thenext free PBA block is still conducted in step 812 and upon the findingof no such free block, at 814, an "error" condition is declared.Whereas, if a free PBA location is found, that PBA is marked as used intable 700 and flash memory, at step 816. Next, in step 818, the state ofthe block is indicated as having been moved by setting the move flag aswell as the setting the appropriate bit in the move status location 714of table 700. The new location of where the block is moved is alsoindicated in table 700 in accordance with the discussion above.

Finally, after steps 818 and 810, data and all corresponding statusinformation, ECC code and LBA are written into the PBA location withinthe flash memory.

As earlier indicated, when a substantial portion of a block has sectorsthat have been moved (in the preferred embodiment, this is eight of thesixteen sectors), the block is declared "old" by setting itscorresponding "old" flag. Periodically, blocks with their "old" flagsset, are erased and may then be re-used (or re-programmed, orre-written).

As can be appreciated, an advantage of the embodiments of FIGS. 10-23 isthat a block need not be erased each time after it is accessed by thehost because if for example, any portions (or sectors) of the block arebeing re-written, rather than erasing the block in the flash memorydevices or moving the entire block to a free area within the flash, onlythe portions that are being re-written need be transferred elsewhere inflash, i.e. free location identified by MVPA block address. In thisconnection, an erase cycle, which is time consuming is avoided untillater and time is not wasted in reading an entire block and transferringthe same.

Improvements to the various embodiments of the present invention, asdescribed thus far, are hereinafter disclosed for efficientlytransferring single sectors that are addressed in sequential order bythe host and that are also being re-written under the direction of thecontroller 506 (in FIG. 10). As will be apparent to those skilled in theart, while such improvements include moving sectors within a block froma first area within the nonvolatile memory to an unused area within thenonvolatile memory, there is less storage area utilized within thecontroller thereby providing a smaller and less expensive solution.Specifically, the need for maintaining: 1) MBPBA block address locations704 and sector move status locations 714 (shown in FIGS. 11-21) withinthe SPM RAM block 548 of the controller 506 (shown in FIG. 10); and 2)sector status locations 760 for every block in the memory unit 508(shown in FIG. 10), as disclosed hereinabove with respect to theembodiment of FIGS. 10-23, is avoided. Furthermore, the number ofoperations necessary for performing such sequential single sector movesis substantially decreased thereby yielding higher system performance.

One embodiment of such an improvement of the present invention, is shownin flow chart form in FIGS. 24-26, to utilize the digital system 500 ofFIG. 10 to reduce the number of read and write cycles associated withre-writing single sectors which are arranged in sequential order.

In systems such as digital cameras, for example, wherein the digitalsystem 500 of the present invention may be employed, the host 502 (inFIG. 10), under the direction of the controller 506, commonly transfersa large quantity of information in the form of picture frames with eachframe typically having 1648 sectors for storage within the flash memoryunit 508. In such applications, information received by the controller506, from the host 502, is generally arranged in sectors that are insequential order. For example, as will be discussed through examplesprovided hereinbelow, the host may command the controller to store datain sectors addressed LBA 5 through LBA 15. As will be apparent shortly,the improved embodiments of the present invention, take advantage of thesequential addressing of sectors by the host when such sectors are beingre-accessed in such a way as to avoid unnecessary sector transfers whileyet avoiding the need for erase-before-write operations. As statedabove, such an improvement utilizes the structure shown in FIG. 10 inconjunction with the method of FIGS. 24-26 outlined in flow chart form.

Most of the steps outlined in FIGS. 24-26 are performed by themicroprocessor block 524, included within the controller 506 of FIG. 10.The microprocessor block 524 executes instructions that are stored inthe microprocessor RAM block 530 for performing most of the stepsoutlined in FIGS. 24-26. It should, however, be obvious to those ofordinary skill in the art that these steps may be performed by hardwaremeans rather than by the microprocessor.

FIG. 27 shows an example of what the contents of a look-up table 1030stored in the SPM RAM block 548 may maintain. Table 1030 is formed of anarray of volatile storage locations (RAM) organized in LBA/PBA rows andcolumns. Each row is addressed by a nine-bit LBA value, LBA row address1032, such as LBA 0, 1, 2, 3, . . . , n-1. The number of rows is afunction of the memory capacity afforded by the memory unit 508. Forexample, a memory capacity within the nonvolatile memory unit 508 of atleast 4 Mbytes can store 500 blocks (each block having 16 sectors andeach sector being 512 bytes) therein and 500 blocks require 500 rows inthe table 1030. The columns of table 1030 comprise of a nine-bit blockaddress 1034, a `defect` flag 1036, a `used` flag 1038 and an `old` flag1040 for indicating the status of each block within the memory unit 508(the reader is reminded that an LBA value is used to address a sector ofinformation received from the host while a PBA, developed by thecontroller, is used to address a sector of information within amulti-sectored block that is stored in the memory unit 508).

For ease of understanding, the flow chart of FIGS. 24-27 is discussedwith reference to the contents of table 1030, as shown in FIG. 27, aswell as examples of the contents of table 1030, as shown in FIGS. 28-38.

In FIG. 24, step 1000 is shown to include a command sent from the host502 to the controller 506 for writing a sector of information to thememory unit 508. The sector of information is addressed by the host andthis host-provided address is transformed to an LBA value, i.e. LBA X,by the controller. As discussed hereinabove with respect to otherembodiments of the present invention, the host interface block 520receives the host command, including sector information and address, anddevelops LBA X therefrom for addressing an LBA/PBA row within the table1030 in FIG. 27.

LBA X is developed from an address provided by the host that may beeither in LBA format or CHS format, in which case it is transformed toan LBA format. The LBA address is 16 bits in the preferred embodimentbut is four least significant bits (LSBs) are masked and the remaining12 bits are shifted four times to the right, the nine LSB bits of theshifted value are used to address the LBA/PBA rows of table 1030 at1032. Nine bits are used for the row addressing to address 500 blocks inthe table 1030. Alternatively, if the memory unit 508 has a differentcapacity and other numbers of blocks are utilized, a correspondingbit-size is used as earlier described. Similarly, in alternativeembodiments, a block may comprise of a different number of sectors.Consistent therewith, the number of bits being masked from the addressreceived from the host will be different. For example, if a 32-sectoredblock size is employed, 5 bits would be masked from the address insteadof the current 4 bits as performed by the system of the preferredembodiment. Furthermore, a sector of information is organized to includea user data portion that is 512 bytes and an overhead portion, thelatter having at least an ECC field and may be further stored with flagand address information in the memory unit 508.

Referring back to FIG. 24, upon receipt of such a command by the hostinterface block 520 (of the controller 506), the microprocessor block524 (also within the controller 506), in step 1002, compares the addressof the sector being accessed, i.e. LBA X, to a PREV₋₋ LBA sectoraddress, the latter having been previously stored in a storage location,such as a register (named moved LBA register 1054 in later figures),within the microprocessor block 524. If LBA X and PREV₋₋ LBA are equal,step 1004, the write command from the host is a sequential write commandand the microprocessor block 524 checks as to whether the block that isaddressed by LBA X has been written to previously by checking the VPBA,which is a nine-bit address of the block assigned to a corresponding LBA(as will be explained further) and the contents of the block address1034 of SPM RAM block 548.

As an example, if LBA 5 was commanded to be written by the host, thefour LSBs of the binary notation of the number `5` would be maskedresulting in the value `0` and in FIG. 27, the VPBA block address 1034corresponding to LBA 0, which in this case is set to `1FF` indicatingthe block is not yet used, would be checked. If the VPBA is valid, i.e.is a value other than all one's (`1FF` in Hex.), the microprocessorblock 524 checks a move pending flag, which is a bit and when setindicates that information is stored by the microprocessor. The movepending flag may be optionally stored in the SPM RAM block 548, as shownin FIG. 27 at column 1042 instead of by the microprocessor. The decisionas to where the pending move flag may be stored is a design choicealthough it should be noted that the pending move flag, whether storedin the microprocessor block or the SPM RAM, is only a one bitinformation. This is because there can only be one block that is in theprocess of being moved from one location in the nonvolatile memory unit508 to another location therein and the move pending flag indicateswhether or not such a block move is pending. It should be obvious tothose of ordinary skill in the art that in alternative embodiments, morethan one block may be pending a move. However, in such animplementation, the microprocessor must keep track of more LBAs and morehardware in needed. The determination as to whether to use one or morethan one pending move blocks in a matter of design choice.

In the case where there is a pending block move, i.e. at least onesector of a block that has been re-written by the host prior to erasurethereof has been moved to another block within the memory unit 508. Thatis, in FIG. 24, after step 1006, step 1018 follows and LBA X sectorinformation is written to the block housing the sectors being moved.Thereafter, in step 1020, the microprocessor increments LBA X by one andstores this incremented value in the PREV₋₋ LBA location.

Referring back to the top of FIG. 24, at step 1002, if LBA X does notmatch the PREV₋₋ LBA, the implication is that the address of the sectorcurrently being accessed by the host does not sequentially follow theaddress of the sector previously accessed by the host. Accordingly, asshown at step 1022, in FIG. 25, the entire block of information wheresectors were previously written are transferred to a new block locationdefined by the block location to which the old block is being moved. Thefollowing step is to perform an erase operation of all locations of ablock that is located at an address corresponding to LBA X in the memoryunit 508, step 1024, prior to its re-use. Thereafter, at step 1026, amove PBA register, which is a storage location for maintaininginformation regarding the location of the block that is in the processof being moved, is cleared as is the move pending flag and the processresumes from step 1004 in FIG. 24.

In FIG. 24, if the VPBA at 1034 that corresponds to LBA X is not valid(or not `1FF` as explained above), a search is conducted by the SPMcontrol block 546 (in FIG. 10) for locating a free block in memory unit508, as shown in FIG. 26 at step 1028. The `used` flag corresponding tothe PBA X location in the flash memory unit 508 is set, indicating thatthe LBA X block has been re-accessed prior to erasure thereof, as shownat step 1029. Later, at step 1031, the VPBA of the located free block isstored in one of the locations of the look-up-table 1030, this locationbeing in one of the rows of column 1034 that corresponds to LBA X inFIG. 27. After step 1031 in FIG. 26, the process flows back to step 1016of FIG. 24.

Similarly, in FIG. 24, if the VPBA at 1034 corresponding to LBA X isvalid, then the move pending flag is checked at step 1006. If the movepending flag was not set at step 1006, a search is conducted for a freeLBA block at step 1008, the pending move flag is set at step 1010, theVPBA of the newly-located free block (of step 1008) is stored in alocation of the look-up-table 1030 at step 1012 and the `used` flagcorresponding to the LBA X block in the memory unit 508 is set.

At step 1016, the VPBA of the newly-located free block is stored in amove PBA register by the microprocessor. The move PBA register is shownas 1052 and the moved LBA register is shown as 1054 in FIG. 27. Both ofthese registers as well as the VPBA block address at 1034 areinitialized to the hexadecimal value `1FF` after initial power-on of thedigital system 500 as well as after erasure of the moved block. In fact,in the above discussion, with reference to the flow charts shown inFIGS. 24-26, wherever it is indicated that any of these registers is"cleared" (such as in step 1026), that is actually setting the contentsof the registers to `1FF`.

After step 1016, data that was received by the host to be written to theLBA X block is written to the newly-located free block in memory unit508, as shown at step 1018. LBA X is then incremented by one and theincremented value is stored in PREV₋₋ LBA at step 1020.

In the manner described above, the preferred embodiment of the presentinvention avoids having to move all of the sectors of a block, thesectors of which are being re-written prior to an erase operation, to anunused location in flash when sectors are singly and sequentiallyaddressed by the host. This is because each time the next sequentialsector is accessed, the block location where the most up-to-date, ormoved, sectors reside is maintained in the move register PBA 1052 andsince the PREV₋₋ LBA value maintains where within the latter block thenext sector should be written, the write operation is performed usingthese two parameters without the necessity of having to move an entireblock. This in turn saves many unnecessary read, write and eraseoperations as required by prior art systems. For example, in the priorart systems, when one sector of a block was re-written, 15 readoperations and 15 write operations were necessarily performed because anentire block of information was moved. The present invention however, aswill be further evident with the examples provided below, avoids these15 read and write operations and only writes the sector beingre-written.

FIG. 28 generally depicts the organization of information within theblocks of the memory unit 508. As shown, each block includes sixteensectors and each sector of a block includes a 512-byte location 1056 forstoring the user data portion of a sector and a storage location 1058for storing the ECC. Each block, i.e. Block 0, Block 1, . . . isaddressed using the 9-bit block address value of 1034 (in FIG. 27) andeach sector within the block is addressed using the 4 masked LSB bitsdiscussed above after they are unmasked. The last sector of each blockfurther includes a block address location 1060 for storing the 9-bit LBAvalue for the block in which the block address location 1060 resides.For example, the block address location 1060 of block 0 will contain thevalue `0`, the block address location 1060 of block 1 will contain thevalue `1`, the block address location 1060 of block 2 will contain thevalue `2` and so forth for all blocks. In fact, these values are thesame as the values of the LBA/PBA row address 1032 (shown in FIG. 27).

Further included in the last sector storage area of each block isstorage location for maintaining the `defect` flag 1062, the `used` flag1064, the `old` flag 1066 and a `good` block flag 1068. The defect andold flags 1062 and 1066, respectively, correspond to the defect and oldflags 1036 and 1040 of the SPM RAM look-up-table 1030 (shown in FIG.27). Each `used` flag corresponds to one sector of a block, therefore,each sector location of each block maintains a `used` flag location. Thereason for having a `used` flag for each sector in the block is toindicate which sectors of the block have been moved or are being writtento the move PBA location (as indicated by the contents of move registerPBA 1052) from the originally-maintained LBA location (as indicated bythe moved LBA register 1054). This is especially useful during moving ofan entire block having some sectors that have been moved and others thathave not.

For example, when a sector that is non-sequential in order is accessedby the host, as noted above with reference to FIGS. 24-26, an entiresector that was in pending move status is moved. In such a case, themicroprocessor checks the `used` flag of each sector within the blockbeing moved and only moves the sectors whose `used` flags are not setbecause those sectors having `used` flags that are set have already beenmoved during sequential accesses by the host.

In an alternative embodiment, rather than utilizing `used` flags toindicate which sectors need be moved, a move locator location that is aword (16 bits) in length is utilized by the microprocessor and stored inthe microprocessor block 524 to do the same. After the time when thepending move flag is set, every time a sector is moved to the move PBAlocation, a bit within the move locator word (shown as 170 in theexample of FIG. 29 and on), corresponding to the location of the sectorwithin the block is set. Therefore, the move locator word acts as a mapto the moved sectors of a block and provides a fast way of identifyingwhich sectors of the block pending move are in the move PBA location andwhich are in the moved LBA location.

The `good` block flag 1068 is maintained in the first and last sectorsof each block for purposes of identifying the location of the block thathas the most recent and accurate copy of the stored file. After a powerinterruption, the contents of the memory unit 508 are used to update thelook-up-table 1030 in the SPM RAM and when a block, for example, was inthe midst of being moved from a first location within the nonvolatilememory unit 508 to a second location within the memory unit 508 prior towhen the power interruption occurred, the block information isdistributed among two blocks that will be addressed by the same LBA. Thesecond block where information was being moved can not be relied uponfor having good data since the move was not completed and theinformation in the first block may in fact be more useful.

When a block is being moved from a first block to a second block, thelast sector of the first block is moved to the second block first andthe `good` block flag 1068 of the last sector of the second block is setto indicate that that block is `good`, thereafter the next to the lastsector of the first block is moved to the corresponding location of thesecond block and so on until all of the sectors including the firstsector of the first block are moved. Thereafter, the `good` block flagof the first sector of the second block is set to indicate that thesecond block is `good`. In this respect, if for example, upon therestoration of power, two blocks have the same LBA values due to theincomplete transfer of block information from one block to another, theblock with the accurate information may be identified by checking thestatus of the two `good` block flags of each block. That is, where ablock has two unmatching `good` block flag values, it was nevercompletely transferred and therefore not a good block. If, on the otherhand, one of the blocks has two matching `good` block flags thatindicate the block is good and the other block has two non-matchingflags that indicate the block is not good and the pending move flag isset, then the microprocessor concludes that the latter block in not goodand uses the information in the former block as valid information.

FIGS. 29-38 are provided to show several examples of the contents of theSPM RAM look-up-table when various types of LBA accesses for a betterunderstanding of the operation of the preferred embodiments as discussedabove relative to FIGS. 24-28. Initially, upon power-up of the system,the values in the block address locations 1034 and the move PBA registerand moved LBA register contents are all set to `1FF` in Hex. The flagsand the move locator word 170 are all set to `0`.

In FIG. 29, after power-up, if the host commands the controller to writeto LBA 0 through LBA 15, the SPM controller is likely to find block 0 tobe free and the microprocessor will use it to store the data provided bythe host. Accordingly, the block address 1034 of the LBA block 0 willcontain the value `0` and the `used` flag for that block will be set.

In FIG. 30, the host commands the controller to write only to LBA 5after the write of FIG. 29. In this case, the hexadecimal notation ofthe value `5` is processed to mask its 4 LSBs thereby yielding the value`0`. But since the location LBA 0 within the memory unit 508 was writtento in the steps of FIG. 29, the SPM controller must search for anotheravailable free block. Assuming such a block to be at address `1`, thecontroller will then write the data that was sent by the host to bestored as LBA 5 to location 5 of LBA block 1, which is the sixth sectorlocation (location 0 being the first sector) within block 1. Then, themove pending flag, which may be stored either in the microprocessorblock or alternatively in the SPM RAM look-up-table at location 1042will be set by the controller.

The controller further writes the address where the block is being movedto, `001`, to the move PBA register 1052 and sets the move pending flag(either in the microprocessor or 1042. It should be noted that the movePBA register 1052 may be saved in the SPM RAM in alternativeembodiments. The controller also sets the `used` flag 1038 correspondingto Block 1 in the SPM RAM look-up-table 1030 and updates the moved LBAregister 1054 to store a `0` value indicating that at least one or moresectors of block 0 have been moved elsewhere in the memory unit 508. Ifmove locator word 170 is used, the controller also updates the same toindicate that LBA 5 has been moved.

From hereon, several different events may occur and in each case, thecontents of the look-up-table 1030 is clearly different. FIGS. 31-33illustrate what the contents of the look-up-table 1030 may be after thestate shown in FIG. 31 in order to demonstrate the effect of the variousevents. In particular, FIG. 31 depicts the contents of 1030 when an LBAwhich is not in block 0 is written, FIG. 32 depicts the contents of 1030when the host writes to LBA 5 again and FIG. 33 depicts the contents of1030 when the host writes to an LBA other than LBA 5 that isnevertheless within block 0, i.e. LBA 6.

In FIG. 31, if the host writes to LBA 17, this is clearly outside ofblock 0 and its a non-sequential sector write since the previous writewas to LBA 5. Here again, the 4 LSBs of the hexadecimal equivalent ofthe value `17` is masked yielding block `1`. The controller then checksthe moved LBA register 1054 against `1` and also checks as to whetherthe move pending flag is set. Since the value in the moved LBA registeris `0`, there is no match and the pending move must be closed. That is,all of the sectors that have not yet been updated in block 1 must bemoved from block 0 to block 1 and block 0 must either be erased ormarked as `old` until some later point in time when it can be erased inthe background prior to writing the new LBA 17 to a block in the memoryunit 508. The new LBA 17 is thus written to block 2, which is the nextfree block found by the SPM controller.

FIG. 32 depicts the case where LBA 5 is again accessed by the host. Insuch a case, the data received from the host for LBA 5 must be writteninto another block and the move PBA register 1052 must be updated withthe next block address and the old block must be marked as `old` forerasure thereof. In this case, the LBA 5 is written to block 2 which isfree and since there was no other sectors written in block 1 other thansector 5, no other sectors are moved from block 1 to block 2 and thecontents of block 0 remains the same. Block 1 is marked as `old` and themove PBA register 1052 is updated to include the value 002 since LBA 5is now presiding in block 2. It is important to note that in thisexample, the need to move all of the sectors from block 0 to block 1 orblock 2, as required by prior art techniques, is avoided therebyeliminating 15 read and 15 write cycles. The controller additionallysets the `used` flag corresponding to block 2.

In FIG. 33, the host writes to LBA 6. Here the controller again masksthe lower 4 bits of the Hex. equivalent of `6` resulting in `0`. Thecontroller then checks this value `0` against the value in the moved LBAregister 1054 and finds that a match exists between the two values.Either by way of checking the move locator word 170 or by checking the`used` flag corresponding to sector 6 for determining whether sector 6has been written to previously or whether it is free for use. In thiscase, since sector 6 was not previously written, the controller merelysets the corresponding bit of the move locator word 170 (oralternatively the used flag of sector 6 in the memory unit 508) andwrites the data received from the host to sector 6 of block 1. No othermodifications to the contents of the look-up-table 1030 is necessary.

If the host continues to write data into LBAs 7,8,9 through 15sequentially, these new LBAs are accordingly written into sectors 7, 8,9 through 15, respectively, by the controller. Once the end of the blockis reached, that is, the last sector, sector 15, is written, sectors 0,1,2,3, and 4 are moved from block 0 to block 1 because the host has notupdated these sectors. Block 0 is then marked `old` and the move PBAregister 1053 and the moved LBA register 1054 are initialized to `1FF`indicating no pending moves. For the same reason, the move locator word170 is also initialized to `0`. This discussion is depicted in theexamples shown in FIGS. 34-38.

Referring to FIG. 38, the status of the look-up-table 1030 is shown whenthe block has been entirely exhausted and the pending move is closed. Asshown, the block address 1034 of LBA block 0 is now `001` and block 0 ismarked as `old` for erasure thereof and registers 1052 and 1054 areshown to have been initialized.

Although the present invention has been described in terms of specificembodiments, it is anticipated that alterations and modificationsthereof will no doubt become apparent to those skilled in the art. It istherefore intended that the following claims be interpreted as coveringall such alterations and modification as fall within the true spirit andscope of the invention.

What is claimed is:
 1. A method for updating sector information in adigital system having a host coupled through a controller to anonvolatile memory device for storing digital information organized intosectors in the nonvolatile memory, each sector having a data portion andan overhead portion and being uniquely identifiable by the host using anLBA (Logical Block Address), the sector information stored within asector location within the nonvolatile memory device, a group of sectorlocations defining a block addressable by the controller using a VPBA(Virtual Physical Block Address), and each sector location within ablock being identifiable by the controller using a PBA (Physical BlockAddress), wherein the sector information stored in a sector location ofa block within the nonvolatile memory device is updated prior to erasureof the block, the method comprising:a. developing an LBA valuecorresponding to a host-addressed sector in response to a commandreceived from the host to re-write sector information to a sectoridentified by the host; b. developing an LBA block address from the LBAvalue for addressing a block within the memory device within which thesector provided by the host is to be stored; c. comparing the LBA valuewith a previous LBA (PREV₋₋ LBA) value to determine whether or not thereis a match; d. if the LBA value and PREV₋₋ LBA match, checking for aprevious write operation to have been performed on the LBA block sincethe last erase operation of the LBA block; e. if a previous writeoperation has been performed, checking for whether or not any of thesectors of the block identified by the LBA block address have beentransferred from one location within the memory device to anotherlocation within the memory device since the occurrence of the last eraseoperation on the LBA block; f. if the sectors of the block identified bythe LBA block address have not been transferred, finding a free blockwithin the nonvolatile memory device for storing the sector information,the free block being identified by a VPBA value corresponding to the LBAblock; g. storing the sector information within a sector location of thefree block corresponding to the sector location of the LBA block; h.storing the VPBA value in a PBA storage location for indicating the freeblock location within the memory device wherein the new sectorinformation resides; i. incrementing the LBA value by one; and j.replacing the PREV₋₋ LBA value with the incremented LBA value, whereinsingle sequential write operations are performed on a sector of a blockthat was previously written and not yet erased without moving all othersectors of the block.
 2. A method as recited in claim 1, wherein a movelocator value is generated and stored in a particular storage location,and further including, after said step of storing the sectorinformation, the step of modifying the value of a move locator storagelocation to indicate the status of which sector within the LBA block hasbeen updated by setting a bit in said particular storage location, theposition of the bit within the move locator value corresponding to theposition of the updated sector within the LBA block.
 3. A method asrecited in claim 1, wherein the sector overhead portion includes a`used` flag that when set indicates that the sector has been written toby the host since the last erase operation, and when not set indicatesthat the sector has not been written to by the host since the last eraseoperation.
 4. A method as recited in claim 3, further comprising afterthe step of finding, the step of setting a `used` flag of the sectoridentified by the LBA value.
 5. A method as recited in claim 1, furthercomprising after the finding step, the step of setting a pending moveflag for indicating that at least a portion of the block has been movedto another location within the memory device.
 6. A method as recited inclaim 1, further including, the step of storing the VPBA valueassociated with the LBA value in an LBA storage location to indicate thelocation of the block within the memory device wherein the sectorinformation of all sectors addressed by the LBA reside.
 7. A method asrecited in claim 1, wherein if the comparing step yields no matchbetween the LBA value and the PREV₋₋ LBA value, transferring sectorinformation for all of the sectors of the block identified by the LBAvalue to the block location identified by the VPBA value stored in thePBA storage location.
 8. A method as recited in claim 7, wherein theblock identified by the LBA value is erased.
 9. A method as recited inclaim 8, further including clearing a move pending flag and a PBAstorage location after said transferring step and performing steps d.through j.
 10. A method as recited in claim 7, wherein the sectoroverhead portion of at least two of the sectors in each block stored inthe memory device each include a bit for storing a `good` block flag andduring said transferring sector information, setting the `good` blockflag of the first sector after the transfer thereof and setting the`good` block flag of the last sector after the transfer thereof.
 11. Amethod as recited in claim 10, wherein after a power interruption, thestate of the `good` block flags of the VPBA block are compared and ifthey are not equal, the sector information within the LBA block isaccessed instead of the VPBA block when the host addresses the LBAblock.
 12. A method as recited in claim 1, wherein if the previous writeoperation of step e has not been performed, finding a free block withinthe nonvolatile memory device for storing sector information, the freeblock identified by a VPBA value corresponding to the LBA block.
 13. Amethod as recited in claims 3 or 12, wherein after said finding step,setting the `used` flags of the sectors of the block identified by theLBA value and performing steps h. through j.
 14. A digital system foruse with a host for receiving commands therefrom and a nonvolatilememory device for storing digital information, the digital informationbeing organized into sectors with each sector having a data portion andan overhead portion, and being stored in a sector location within thenonvolatile memory device, a group of said sector locations defining ablock addressable by the controller using a VPBA (Variable PhysicalBlock Address) value, and each sector location within a block beingidentified by the controller using a PBA (Physical Block Address) value,the digital system comprising:a controller including,a. a host interfacemeans responsive to a write command from the host for re-writing sectorinformation to a sector identified by a sector address and operative togenerate an LBA (Logical Block Address) value corresponding to thehost-addressed sector and further operative to generate an LBA blockaddress from the LBA value for addressing a block within the memorydevice for storing the sector information; b. means for comparing theLBA value with a PREV₋₋ LBA value; c. means for checking for a previouswrite operation to have been performed on the LBA block since the lasterase operation of the LBA block; d. means for detecting whether or notany of the sectors of the block identified by the LBA block address havebeen transferred from one location within the memory device to anotherlocation within the memory device since the occurrence of the last eraseoperation on the LBA block, means for searching for a free block withinthe nonvolatile memory device for storing the sector information, thefree block identified by a VPBA value corresponding to the LBA block; e.means for storing the sector information within a sector location of theVPBA block corresponding to the sector location of the LBA block; f.means for storing the VPBA value in a PBA storage location forindicating the block location within the memory device wherein the newsector information resides; g. means for incrementing the LBA by one,and means for replacing the PREV₋₋ LBA value with the incremented LBAvalue, wherein single sequential write operations are performed on asector of a block that was previously written and not yet erased withoutthe need for moving all other sectors of the block.